//
//  UIView+Extension.swift
//  KKWeibo
//
//  Created by kassia on 16/7/9.
//  Copyright © 2016年 kassia. All rights reserved.
//

import UIKit

extension  UIView {

    //x
    var x: CGFloat {
        get {
            return frame.origin.x
        } set {
            frame.origin.x = newValue
        }
    }
    
    //y
    var y: CGFloat {
        get {
             return frame.origin.y
        } set {
             frame.origin.y = newValue
        }
    }
    
    //宽
    var weight: CGFloat {
        get {
            return frame.size.width
        } set {
            frame.size.width = newValue
        }
    }
    
    //高
    var height: CGFloat {
        get {
            return frame.size.height
        } set {
            frame.size.height = newValue
        }
    }
    
    //中心点X
    var centerX: CGFloat {
        get {
            return center.x
        } set {
            center.x = newValue
        }
    }
    
    //中心点Y
    var centerY: CGFloat {
        get {
            return center.y
        } set {
            center.y = newValue
        }
    }
    
    //  视图大小size
    var size: CGSize {
        get {
            return frame.size
        } set {
        
            frame.size = newValue
        }    
    }
}
